package com.zhongen.oa.task;

import com.zhongen.oa.service.DingTalkService;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Slf4j
@AllArgsConstructor
@Component("deptSyncTask")
public class DeptSyncTask {

	private final DingTalkService dingTalkService;

	@SneakyThrows
	public String sync() {
		dingTalkService.getDeptAndUserFromDingTalk();
		log.info("同步钉钉部门数据", LocalDateTime.now());
		return "0";
	}

}
